package ligne2vie.topos.server.bo.geocell;

/**
 * 
 * @author Alexandre Gellibert <alexandre.gellibert@gmail.com>
 * 
 */
public class BoundingBox {

	private Point northEast;
	private Point southWest;

	public BoundingBox(double north, double east, double south, double west) {
		double north_, south_;
		if (south > north) {
			south_ = north;
			north_ = south;
		} else {
			south_ = south;
			north_ = north;
		}

		// Don't swap east and west to allow disambiguation of
		// antimeridian crossing.

		northEast = new Point(north_, east);
		southWest = new Point(south_, west);
	}

	public double getNorth() {
		return northEast.getLat();
	}

	public double getSouth() {
		return southWest.getLat();
	}

	public double getWest() {
		return southWest.getLon();
	}

	public double getEast() {
		return northEast.getLon();
	}

	public Point getNorthEast() {
		return northEast;
	}

	public Point getSouthWest() {
		return southWest;
	}
}
